package net.neptech.model.schedule;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.neptech.utils.SnowflakeIdGenerator;
import org.hibernate.annotations.GenericGenerator;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author HuangZhengmin
 * @desc  排班冲突记录表实体类
 * @Date 2025/8/12 17:09
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "sche_conflict")
public class ScheConflict implements Serializable {

    @Serial
    private static final Long serialVersionUID = 1L;

  @Id
  @GenericGenerator(name = "snowflake", type = SnowflakeIdGenerator.class)
  @GeneratedValue(generator = "snowflake")
  @Column(name = "conflict_id", nullable = false)

  private Long conflictId; // 冲突ID

  @Column(name = "schedule_id")
  private Long scheduleId; // 关联排班ID

  @Column(name = "user_id")
  private Long userId; // 关联用户ID

  @Column(name = "conflict_date")
  private Date conflictDate; // 冲突日期

  @Column(name = "conflict_type")
  private Integer conflictType; // 冲突类型(1-时间重叠 2-资质不符 3-超负荷 4-规则冲突)

  @Column(name = "conflict_details", length = 500)
  private String conflictDetails; // 冲突详情描述

  @Column(name = "related_id")
  private Long relatedId; // 关联冲突对象ID

  @Column(name = "resolve_status", nullable = false)
  private Integer resolveStatus = 0; // 解决状态(0-未解决 1-已解决 2-已忽略)

  @Column(name = "resolve_comment", length = 255)
  private String resolveComment; // 解决备注

  @Column(name = "create_time")
  private Date createTime; // 创建时间

  @Column(name = "update_time")
  private Date updateTime; // 更新时间
}
